﻿using System;
using System.Collections.Generic;
using Abp.Application.Services.Dto;
using Abp.Authorization.Users;
using Abp.AutoMapper;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System.ComponentModel;

namespace LeadThing.AbpZeroTemplate.Authorization.Users.Dto
{
    [AutoMapFrom(typeof(User))]
    public class UserListDto : EntityDto<long>, IPassivable, IHasCreationTime
    {
        public string Name { get; set; }

        public string Surname { get; set; }

        public string UserName { get; set; }

        public string EmailAddress { get; set; }

        public string PhoneNumber { get; set; }

        public Guid? ProfilePictureId { get; set; }

        public bool IsEmailConfirmed { get; set; }

        public List<UserListRoleDto> Roles { get; set; }

        public DateTime? LastLoginTime { get; set; }

        public bool IsActive { get; set; }

        public DateTime CreationTime { get; set; }

        [AutoMapFrom(typeof(UserRole))]
        public class UserListRoleDto
        {
            public int RoleId { get; set; }

            public string RoleName { get; set; }
        }

        /// <summary>
        /// 镇ID
        /// </summary>
        public virtual int TownID { get; set; }

        /// <summary>
        /// 区ID
        /// </summary>
        public virtual int AreaID { get; set; }

        /// <summary>
        /// 村ID
        /// </summary>
        public virtual int VillageID { get; set; }

        /// <summary>
        /// 文件ID
        /// </summary>
        public virtual int FileID { get; set; }

        /// <summary>
        /// 设备令牌
        /// </summary>
        public string DeviceToken { get; set; }

        /// <summary>
        /// 客户端ID
        /// </summary>
        public string ClientID { get; set; }

        /// <summary>
        /// 用户类型
        /// </summary>
        public string UserType { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int SortID { get; set; }

        #region 扩展字段

        public string ImageUrl { get; set; }

        /// <summary>
        /// 镇名称
        /// </summary>
        [DisplayName("镇")]
        public string TownTitle { get; set; }

        /// <summary>
        /// 区名称
        /// </summary>
        [DisplayName("区")]
        public string AreaTitle { get; set; }

        /// <summary>
        /// 村名称
        /// </summary>
        [DisplayName("村庄")]
        public string VillageTitle { get; set; }

        /// <summary>
        /// 角色名称
        /// </summary>
        public string RoleName { get; set; }

        #endregion
    }
}